package com.hyw.encryption.provider.extractor.http;

/**
 * 具体使用场景，参考{@link HttpHeaderKeyExtractor}描述
 * 
 * @author Hongyu
 */
public class HttpHeaderUidContext {

  private static final String EMPTY = "";

  private static final ThreadLocal<String> context = ThreadLocal.withInitial(() -> EMPTY);

  private HttpHeaderUidContext() {
    throw new UnsupportedOperationException();
  }

  public static void set(String uid) {
    context.set(uid);
  }

  public static String get() {
    return context.get();
  }

  public static void clear() {
    context.remove();
  }
}
